/**
 * @FileName ConcreteState1.java
 * @Package com.designMode.state
 * -------------------------------------
 * @function Please write description of function
 * @Date 2016-1-19 下午12:56:31
 * -------------------------------------
 * Copyright (c) 2016,顾博君 All Rights Reserved.
 */
package com.designMode.state;

/**
 * @author 顾博君
 * @ClassName ConcreteState1
 * @Date 2016-1-19 下午12:56:31
 * @Function 具体状态角色1
 */
public class ConcreteState1 extends State {

    @Override
    public void handle1() {
        // 该状态下必须处理的逻辑
        System.out.println("ConcreteState1->handle1()");
    }

    @Override
    public void handle2() {
        System.out.println("状态转换");
        // 设置当前状态为state2
        super.context.setCurrentState(Context.STATE2);
        // 过渡到state2状态，由Context实现
        super.context.handle2();
    }

    @Override
    public String toString() {
        return "状态1";
    }
}
